//ACCEPTED
#include <cstdio>
#include <cstring>

int n, k;
int sum[101];

void read(){
	int t;
	scanf("%d %d", &n, &k);
	for(int i=0;i<n;i++){
		scanf("%d", &t);
		sum[t]++;
	}
}
void process(){
	int i, g=0;
	while(sum[k]!=n){
		g++;
		for(i=k-1;i>0;i--){
			if(sum[i]){
				sum[i]--;
				sum[i+1]++;
			}
		}
	}
	printf("%d",g);
}

int main(){
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	read();
	process();
	return 0;
}

